﻿@model mtm.Votes.Models.VotesModel
@{ 
    /* Copyright © 2009 - 2010 Oleg Stuhin & Rostislav Haitovich 
       To learn more about mytrip.mvc visit  
       http://mytripmvc.net  http://mytripmvc.codeplex.com 
       mytripmvc@gmail.com
       license: Microsoft Public License (Ms-PL) */ 
}
@{
    ViewBag.Title = Html.MytripPageTitle(VotesLanguage.edit_vote, "/");
    ViewBag.Keywords=Html.MytripPageTitle(VotesLanguage.edit_vote, ",");
    ViewBag.Description=Html.MytripPageTitle(VotesLanguage.edit_vote, ",");
}
@section scriptlink{
@Html.ScriptLink("jquery.validate.min.js,jquery.validate.unobtrusive.min.js,ui.datepicker.js,Page/Votes.js")
@if (mtm.Core.Settings.LocalisationSetting.culture() == "ru-ru")
{
@Html.ScriptLink("ui.datepicker-ru.js")
}
}
@section content{
<h1 class="title">
@VotesLanguage.edit_vote</h1>
@using (Html.BeginForm()){
<fieldset>    
<div class="editor-label">
@Html.HiddenFor(x=>x.QuestionId)
@Html.LabelFor(model => model.Question, VotesLanguage.question_max_lenght)
</div><div class="editor-field">
@Html.TextAreaFor(x=>x.Question,new {@class="message", style = "width: 350px;height:50px"})
@Html.ValidationMessage("Question")
</div><div class="editor-label">
@Html.LabelFor(model => model.Count, VotesLanguage.choose_number_of_answers)
@Html.DropDownListFor(model => model.Count, Model.QtAnswers)
</div>
@{int ctr = 0;}
@foreach (var answer in Model.Answers){
<div class="editor-label">
@Html.LabelFor("Answers_"+ctr+"_", VotesLanguage.answer+" "+ (ctr+1))
</div><div class="editor-field">
@Html.TextBoxFor(x=>x.Answers[ctr],new { style = "width: 350px;"})
@Html.ValidationMessage("Answers_"+ctr+"_") 
</div>
ctr++;
} 
<div class="editor-label">
@Html.CheckBoxFor(model => model.AllCulture) 
@Html.LabelFor(model => model.AllCulture, VotesLanguage.display_in_all_languages)
</div><div class="editor-label">
@Html.CheckBoxFor(model => model.OnlyForRegisterUser)
@Html.LabelFor(model => model.OnlyForRegisterUser, VotesLanguage.only_for_registered_users)
</div><div class="editor-label">
@Html.CheckBoxFor(model => model.Active)
@Html.LabelFor(model => model.Active, VotesLanguage.make_active)
</div><div class="editor-label">
@Html.LabelFor(model => model.CloseDate, VotesLanguage.close_date) 
</div><div class="editor-field"> 
@Html.TextBoxFor(model => model.CloseDate)
@Html.ValidationMessageFor(model => model.CloseDate)
</div><div class="button">
@Html.MytripButton(VotesLanguage.edit,true,"left")
@Html.MytripButton("/Votes/Index", CoreLanguage.cancel, false,"left") 
</div>
</fieldset>
} 
}

